<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>五彩导航</title>
  <style>
    a {
      display: inline-block;
      width: 120px;
      height: 58px;
      text-decoration: none;
      color: white;
      line-height: 48px;
      text-align: center;
      /* 设置图片不平铺，其实这里也可以不设置 */
      background-repeat: no-repeat;

    }

    .bg1 {
      background-image: url(../壁纸/bg1.png);
    }

    .bg2 {
      background-image: url(../壁纸/bg2.png);
    }

    .bg3 {
      background-image: url(../壁纸/bg3.png);
    }

    .bg4 {
      background-image: url(../壁纸/bg4.png);
    }

    /* 鼠标放上去的样式变化 */

    .bg1:hover {
      background-image: url(../壁纸/bg5.jpg);
    }

    .bg2:hover {
      background-image: url(../壁纸/bg6.png);
    }

    .bg3:hover {
      background-image: url(../壁纸/bg7.png);
    }

    .bg4:hover {
      background-image: url(../壁纸/bg8.png);
    }
  </style>

</head>

<body>
<div class="nav">
  <a href="#" class="bg1">五彩导航</a>
  <a href="#" class="bg2">五彩导航</a>
  <a href="#" class="bg3">五彩导航</a>
  <a href="#" class="bg4">五彩导航</a>
</div>
</body>

</html>